import Mock from 'mockjs'
// import { param2Obj } from '@/utils'

const collegeList = Mock.mock({
  'msg': 'success',
  'schoolList|1-100': [{
    'id|1-100': 1,
    'name': Mock.Random.ctitle(10),
    'status': 0,
    'updateDate': Mock.Random.date('yyyy-MM-dd HH:MM:ss'),
    'updateBy': Mock.Random.cname()
  }],
  'code': 0
})

const getSchoolDetailInfo = Mock.mock({
  'msg': 'success',
  'code': 0,
  'info': {
    'detailinfo': {
      'id': 1,
      'name': '1',
      'status': 0,
      'projectId1stName': null,
      'projectId2ndName': null,
      'introduceText': '1',
      'introducePics': '1',
      'useDegreeNum': 8
    },
    'page': {
      'totalCount': 8,
      'pageSize': 1,
      'totalPage': 8,
      'currPage': 1,
      'list|1-100': [{
        'degreeId': 2,
        'degreeName': Mock.Random.ctitle(7),
        'status': 1,
        'updateTime': Mock.Random.date('yyyy-MM-dd HH:MM:ss'),
        'updateBy': Mock.Random.cname(),
        'deadlineDate': Mock.Random.date('yyyy-MM-dd HH:MM:ss'),
        'enrollDate': Mock.Random.date('yyyy-MM-dd HH:MM:ss')
      }]
    }
  }
})

const getSchoolLoglist = Mock.mock({
  'msg': 'success',
  'code': 0,
  'page': {
    'totalCount': 4,
    'pageSize': 1,
    'totalPage': 4,
    'currPage': 1,
    'list': [{
      'id': 1,
      'name': Mock.Random.ctitle(5),
      'projectId1stName': Mock.Random.ctitle(3),
      'projectId2ndName': Mock.Random.ctitle(6),
      'introduceText': '1',
      'introducePics': '1',
      'status': 0,
      'createDate': Mock.Random.date('yyyy-MM-dd HH:MM:ss'),
      'updateDate': Mock.Random.date('yyyy-MM-dd HH:MM:ss'),
      'createBy': Mock.Random.cname(),
      'updateBy': Mock.Random.cname()
    }]
  }
})

const saveSchool = Mock.mock({
  'name': '33333333',
  'projectId1st': 0,
  'projectId2nd': 0,
  'introduceText': 0,
  'introducePics': 0,
  'status': 0,
  'createBy': 0
})

const getProj1st2nd = Mock.mock({
  'msg': 'success',
  'projectList': [{
    'id': 11,
    'name': '会计证',
    'project2ndList': [{
      'id': 1101,
      'proj1stId': 11,
      'name': '会计证课程'
    },
    {
      'id': 1102,
      'proj1stId': 11,
      'name': '会计进阶课程'
    },
    {
      'id': 1103,
      'proj1stId': 11,
      'name': '狐逻会计'
    },
    {
      'id': 1199,
      'proj1stId': 11,
      'name': '其他'
    }
    ]
  }, {
    'id': 12,
    'name': '会计证2',
    'project2ndList': [{
      'id': 1101,
      'proj1stId': 12,
      'name': '会计证课程2'
    },
    {
      'id': 1102,
      'proj1stId': 12,
      'name': '会计进阶课程2'
    },
    {
      'id': 1103,
      'proj1stId': 12,
      'name': '狐逻会计2'
    },
    {
      'id': 1199,
      'proj1stId': 13,
      'name': '其他2'
    }
    ]
  }],
  'code': 0
})

export default {
  getSchoolList: config => {
    return collegeList
  },
  getSchoolDetailInfo: config => {
    return getSchoolDetailInfo
  },
  getSchoolLoglist: config => {
    return getSchoolLoglist
  },
  saveSchool: config => {
    return saveSchool
  },
  getProj1st2nd: config => {
    return getProj1st2nd
  }
}
